package com.xiongwei.observer;

/**
 * @author XiongWei
 * @date 2024/2/1
 */
public class SinaWeather extends Observer{

    private float temperature;
    private float humidity;
    private float pressure;

    @Override
    public void update(float temperature, float humidity, float pressure) {
        this.temperature = temperature;
        this.humidity = humidity;
        this.pressure = pressure;
        display();
    }

    @Override
    public void display() {
        System.out.println("新浪天气");
        System.out.println("温度：" + temperature);
        System.out.println("湿度：" + humidity);
        System.out.println("气压：" + pressure);
    }
}
